package fragments.demo;

import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class ArticleListFragment extends Fragment {

	@Override
	public void onAttach(Activity activity) {
		super.onAttach(activity);
		Log.v("Fragment Cycle", "Fragment -> onAttach()");
	}
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		Log.v("Fragment Cycle", "Fragment -> onCreate()");
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		Log.v("Fragment Cycle", "Fragment -> onCreateView()");
		
		//parameter1： 指定布局文件 
		//parameter2：指定父容器的ViewGroup， 
		//paramenter3：指定的布局是否附着到ViewGroup（第二个参数）
		return inflater.inflate(R.layout.article_list_fragment, container, false);
	}

	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		Log.v("Fragment Cycle", "Fragment -> onActivityCreated()");
	}

	@Override
	public void onStart() {
		super.onStart();
		Log.v("Fragment Cycle", "Fragment -> onStart()");
	}
	
	@Override
	public void onResume() {
		super.onResume();
		Log.v("Fragment Cycle", "Fragment -> onResume()");
	}
	
	@Override
	public void onPause() {
		super.onPause();
		Log.v("Fragment Cycle", "Fragment -> onPause()");
	}

	@Override
	public void onStop() {
		super.onStop();
		Log.v("Fragment Cycle", "Fragment -> onStop()");
	}

	@Override
	public void onDestroyView() {
		super.onDestroyView();
		Log.v("Fragment Cycle", "Fragment -> onDestroyView()");
	}

	@Override
	public void onDestroy() {	
		super.onDestroy();
		Log.v("Fragment Cycle", "Fragment -> onDestroy()");
	}
	
	@Override
	public void onDetach() {	
		super.onDetach();
		Log.v("Fragment Cycle", "Fragment -> onDetach()");
	}
}
